package org.wu.acw.core.parser;


import org.wu.framework.inner.lazy.orm.spring.prop.LazyApplicationProperties;
import org.wu.framework.lazy.orm.core.config.prop.LazyDataSourceAttribute;
import org.wu.acw.core.domain.uo.AcwInstanceUo;

/**
 * 本地服务数据初始化
 */
public class LocalServiceDataInitialization {

    private final LazyDataSourceAttribute lazyDataSourceAttribute;
    private final LazyApplicationProperties lazyApplicationProperties;

    public LocalServiceDataInitialization(LazyDataSourceAttribute lazyDataSourceAttribute, LazyApplicationProperties lazyApplicationProperties) {
        this.lazyDataSourceAttribute = lazyDataSourceAttribute;
        this.lazyApplicationProperties = lazyApplicationProperties;
    }
    // 初始化本地项目到acw

    public void InitializeLocalProjectToAcw() {
        AcwInstanceUo acwInstanceUo = new AcwInstanceUo();
        acwInstanceUo.setInstanceName(lazyApplicationProperties.getName());
        acwInstanceUo.setUrl(lazyDataSourceAttribute.getUrl());
        acwInstanceUo.setDriverClassName(lazyDataSourceAttribute.getDriverClassName());
        acwInstanceUo.setUsername(lazyDataSourceAttribute.getUsername());
        acwInstanceUo.setPassword(lazyDataSourceAttribute.getPassword());

    }

}
